package cn.nacos.common.controller;

import cn.nacos.common.entity.Result;
import cn.nacos.common.entity.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:ZhouYang
 * @Description:
 * @Date: Created in 2020/8/31 12:07
 * @Modified By：
 */

@Slf4j
@RestController
public class AuthErrorController {



    @GetMapping("/autherror")
    public Result authError(@RequestParam Integer code){
        if(code ==1 ){
            return  new Result(ResultCode.UNAUTHENTICATED);
        }

        if(code ==2){
            return  new Result(ResultCode.UNAUTHORISE);
        }
        return null;
    }
}
